package com.drawu.drawuspring.controller;


import com.drawu.drawuspring.domain.Result;
import com.drawu.drawuspring.service.ILikedRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 点赞记录表 前端控制器
 * </p>
 *
 * @author hui
 * @since 2024-10-12
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/likes")
@Tag(name = "点赞记录表", description = "点赞记录表 API")
public class LikedRecordController {

    private final ILikedRecordService likedRecordService;

    @Operation(summary = "批量查询点赞状态")
    @GetMapping("/list")
    public Result<Set<Integer>> likedRecordList(@RequestParam("postIds") List<Integer> postIds) {
        return Result.success( likedRecordService.getLikedRecordList(postIds));
    }



}
